function mwcond = mwcondition(sbar,p)

% solve the model given sbar
%r = solvemodel(sbar,p);
r = solvemodelnew(sbar,p);

% compare lowest wage to minimum wage
mwcond = min((r.w(1)-p.mw)/r.w(1),sbar);
 
end